<template>
  <div class="game-next">
    <div class="game-header">
      <el-carousel :interval="3000" arrow="never" height="400px">
        <el-carousel-item>
          <img src="./images/1.jpg" alt="" />
        </el-carousel-item>
        <el-carousel-item>
          <img src="./images/2.png" alt="" />
        </el-carousel-item>
        <el-carousel-item>
          <img src="./images/3.png" alt="" />
        </el-carousel-item>
        <el-carousel-item>
          <img src="./images/4.png" alt="" />
        </el-carousel-item>
        <div class="banner-select">
          <ul class="banner-list">
            <li class="banner-item">
              <!-- <img src="./images/1.jpg" class="banner-img" /> -->
              <!-- <span class="banner-title">恭喜DRX获得S12冠军！</span> -->
              <div
                class="banner-title"
                :style="`backgroundImage: url(${imgurl})`"
              >
                恭喜DRX获得S12冠军！
              </div>
            </li>
            <li class="banner-item">
              <span class="banner-img"></span>
              <span class="banner-title">IEM里约Major</span>
            </li>
            <li class="banner-item">
              <span class="banner-img"></span>
              <span class="banner-title">2022第五人格IVL秋季赛！</span>
            </li>
            <li class="banner-item">
              <span class="banner-img"></span>
              <span class="banner-title">PMGC全球总决赛！</span>
            </li>
          </ul>
        </div>
      </el-carousel>
    </div>
  </div>
</template>

<script>
export default {
  name: "BHead",
  data() {
    return {
      imgurl:
        "",
    };
  },
};
</script>

<style lang="less" scoped>
.banner-select {
  position: absolute;
  top: 100px;
  right: 20px;
  width: 220px;
  height: 260px;
  z-index: 999;
  border-radius: 15px;
}
.banner-select .banner-item {
  position: relative;
  display: flex;
  align-items: center;
  background-color: aqua;
  justify-content: center;
  width: 230px;
  height: 64px;
  flex-direction: column;
  cursor: pointer;
}
.banner-select .banner-title {
  width: 100%;
  height: 100%;
  background-size: cover;
  font-size: 16px;
  font-weight: 600;
  color: #fcfcfc;
  display: flex; //flex布局
  align-items: center; //让img放在div的中间，居中
  justify-content: center;
}

.el-carousel__item {
  overflow: hidden; //img如果超出这个div会隐藏超出部分
  display: flex; //flex布局
  align-items: flex-start; //让img放在div的中间，居中
  justify-content: center;
  width: 100%;
}
.el-carousel__item img {
  // width: 100%;
  height: 400px;
}
</style>
